<HTML><HEAD><TITLE>/home/steder/Projects/Tutorials/python/BobChat-v0.3/BobClient.py</TITLE></HEAD>
                  <BODY BGCOLOR=#FFFFFF>
                  <!--header-->
                  <!--script--><PRE><FONT COLOR=#1111CC># Basic For Loop</FONT>
<FONT COLOR=#3333CC><B>for</B></FONT> item <FONT COLOR=#3333CC><B>in</B></FONT> list:
    dosomething(item)

<FONT COLOR=#1111CC># The traditional C for loop has a different form in Python:</FONT>
<FONT COLOR=#3333CC><B>for</B></FONT> x <FONT COLOR=#3333CC><B>in</B></FONT> range(0, 100):
    dosomething(x)

<FONT COLOR=#1111CC># More interesting example:</FONT>
<FONT COLOR=#3333CC><B>def</B></FONT><A NAME="buglove"><FONT COLOR=#CC0000><B> buglove</B></FONT></A>( UIUC ):
    <FONT COLOR=#3333CC><B>for</B></FONT> bug <FONT COLOR=#3333CC><B>in</B></FONT> UIUC:
        <FONT COLOR=#3333CC><B>if</B></FONT> type( bug ) == type( chinese_lady_beetle() ):
            crush( bug )
        <FONT COLOR=#3333CC><B>else</B></FONT>:
            hug( bug )

</PRE>
                  <!--footer-->
                  </BODY>
